package cn.demomaster.quickui_sample.ui.fragment.helper;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import cn.demomaster.quickrouter.fragment.QuickFragment;
import cn.demomaster.quickui.annotation.ActivityPager;
import cn.demomaster.quickui.annotation.ResType;
import com.demomaster.quickcompat.widget.toast.QdToast;
import cn.demomaster.quickui_sample.R;


/**
 * Squirrel桓
 * 2018/8/25
 */

@ActivityPager(name = "无障碍服务", preViewClass = TextView.class, resType = ResType.Custome)
public class AccessibilityServiceFragment extends QuickFragment {

    Button btn_01;

    @NonNull
    @Override
    public View onGenerateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View mView = inflater.inflate(R.layout.fragment_layout_accessibilityservice, null);
        return mView;
    }
    
    public void initView(View rootView) {
        btn_01 = rootView.findViewById(R.id.btn_01);
        btn_01.setOnClickListener(v -> {
            //QDAccessibilityService.addPackage("cn.demomaster.quickdevelop");
//            if (!QuickAccessibilityService.getInstance().getAccessibilityService().isEnable(getContext(), QuickAccessibilityService.getAccessibilityClass())){
//                //跳转系统自带界面 辅助功能界面
//                QuickAccessibilityService.getInstance().getAccessibilityService().startSettintActivity(mContext);
//            }else {
//                QdToast.show(mContext, "无障碍已开启");
//            }
        });
    }
}